//
//  MapViewController.h
//  WLTagent
//
//  Created by Sergei Sevriugin on 8/13/09.
//  Copyright 2009 Bellwood Systems. All rights reserved.
//

#import <UIKit/UIKit.h>
#import <CoreLocation/CoreLocation.h>

#import	<MapKit/MKMapView.h>
#import <MapKit/MKPinAnnotationView.h>
#import <MapKit/MKPointAnnotation.h>
#import <MapKit/MKPolyline.h>

#import "ViewDataManagement.h"
#import "iTrackGoogleMaps.h"
#import "iTrackAnnotation.h"


@interface MapViewController : UIViewController <MKMapViewDelegate, ViewDataManagement> {
	    
	ITGoogleMaps*				gmaps;
	NSInteger					currentMapId;
	BOOL						loaded;
	
	NSMutableArray*				annotations;
	BOOL						recordLocations;
	//
	//							annotations[count-1] -- current/final User Location
	//							annotations[count-2] -- current/final User Path
	//							annotations[count-3] -- start User Location
	//							...
	//							annotations[0]
	//
	//							recordLocations == NO  :
	//							annotations[count-1] -- final User Location
	//							annotations[count-2] -- final User Path
	//							annotations[count-3] -- start User Location
	//							
	//							recordLocations == YES :
	//							[annotations[count-1] updateLocation:[userLocation location]]
	//							[annotations[count-2] addLocation:[userLocation location]] 	
	//							
	//							startRecLocations :
	//							[annotations addObjects:ann_loc, ann_path, ann_start]
	//							[ann_start updateLocation:[userLocation location]]
	//							[ann_path updateLocation:[userLocation location]]
	//							[ann_loc updateLocation:[userLocation location]]
	//							recordLocations = YES
	//
	//							stopRecLocations :
	//							recordLocations = NO
	//
	BOOL						firstLocation;
	NSInteger					lastSavedAnnotation;
}

@property (nonatomic, retain) ITGoogleMaps*			gmaps;
@property (nonatomic, assign) NSInteger				currentMapId;
@property (nonatomic, assign) BOOL					loaded;

- (void) loadAnnotations;
- (IBAction) myShowDetailsMethod:(id)sender;

- (IBAction)addClicked:(id)sender;
- (IBAction)recClicked:(id)sender;
- (IBAction)pauseClicked:(id)sender;

- (void) startRecLocations;
- (void) stopRecLocations;

@end
